<!doctype html>
<html lang="{idioma_js}">
    <head>
        <title>CMS 2.0+ | {titulo} | Link Nacional</title>
        {include_header_view}
        <script>
            /*
            $(document).ready(function(){
                $("#entrega").click(function(){
                    //$("#dados_entrega").toggle();
                    if ($("#entrega").attr("checked")){
                        $("#dados_entrega").show();
                        //$("#dados_entrega input").attr("required", "required");
                    }else{
                        $("#dados_entrega").hide();
                        //$("#dados_entrega input").removeAttr("required");
                    }
                    
                });
            });
            */
            
            $(window).load(function(){
                $.datepicker.regional['{date_lingua}'] = {
                    closeText: '{date_fechar}',
                    prevText: '{date_ant}',
                    nextText: '{date_prox}',
                    currentText: '{date_hoje}',
                    monthNames: ['{date_mes_1}','{date_mes_2}','{date_mes_3}','{date_mes_4}','{date_mes_5}','{date_mes_6}',
                        '{date_mes_7}','{date_mes_8}','{date_mes_9}','{date_mes_10}','{date_mes_11}','{date_mes_12}'],
                    monthNamesShort: ['{date_mes_ab_1}','{date_mes_ab_2}','{date_mes_ab_3}','{date_mes_ab_4}','{date_mes_ab_5}','{date_mes_ab_6}',
                        '{date_mes_ab_7}','{date_mes_ab_8}','{date_mes_ab_9}','{date_mes_ab_10}','{date_mes_ab_11}','{date_mes_ab_12}'],
                    dayNames: ['{date_semana_1}','{date_semana_2}','{date_semana_3}','{date_semana_4}','{date_semana_5}','{date_semana_6}','{date_semana_7}'],
                    dayNamesShort: ['{date_semana_ab_1}','{date_semana_ab_2}','{date_semana_ab_3}','{date_semana_ab_4}','{date_semana_ab_5}','{date_semana_ab_6}','{date_semana_ab_7}'],
                    dayNamesMin: ['{date_semana_ab_1}','{date_semana_ab_2}','{date_semana_ab_3}','{date_semana_ab_4}','{date_semana_ab_5}','{date_semana_ab_6}','{date_semana_ab_7}'],
                    weekHeader: 'Sm',
                    dateFormat: 'yy-mm-dd',
                    firstDay: 0,
                    isRTL: false,
                    showMonthAfterYear: false,
                    yearSuffix: ''};
                
                $.datepicker.setDefaults($.datepicker.regional['{date_lingua}']);
                
                //inicio - limite de ano no calendário
                $( "#data" ).datepicker({
                    changeMonth: true,
                    changeYear: true,
                    yearRange: '1900:Now' 
                },$.datepicker.regional['pt-BR']);//fim
                
               // $("#dados_entrega").hide();
                
                $('#form_cadastro_pessoa').wl_Form({
                    dataType: 'json',
                    onBeforeSubmit: function(){
                       // if ($("#entrega").attr("checked")){
                           // $("#dados_entrega input").removeAttr("required");
                       // }else{
                           // $("#dados_entrega input").attr("required", "required");
                       // }
                    },
                    onSuccess: function (data) {
                        if(data.cod == 999){
                            //$.wl_Alert(data.msg,'success','#content');
                            $.msg(data.msg,{header:data.header,live:10000});
                            $('#form_cadastro_pessoa #id').val(data.id);
                        } else {
                            //$.wl_Alert(data.msg,'warning','#content');
                            $.msg(data.msg,{header:data.header,live:10000});
                            $('#form_cadastro_pessoa').color_campos_form({
                                campos:data.campos
                            });
                        }
                    }
                });
                
                                
            });    
            jQuery(function($){
                $("#telefone").mask("(99) 9999-9999");
            });
        </script>
    </head>
    <body>
        <noscript>
        {lang_java_script}
        </noscript>
        {include_body_header_view}
        {include_body_menu_left_view}

        <section id="content">
            <div class="g12">

                <h1>{titulo} 
                    <span><a href="{base_cms}pessoa/pessoa/consultar" class="small">{descricao_titulo}</a></span>
                </h1>
                

                <form id="form_cadastro_pessoa" name="form_cadastro_pessoa" action="{base_cms}{action_pessoa_gravar}" method="post" autocomplete="off">
                    <input type="hidden" value="{id}" name="id" id="id">
                    <fieldset>
                        <label>{title_acao}</label>
                        <section>
                            <label>{lang_title_status}</label>
                            <div>
                                {status}
                            </div>
                        </section>
                         <section>
                            <label for="referencia">{lang_title_referencia}</label>
                            <div>
                                <input title="{lang_title_referencia}" type="text" id="nome" name="referencia" value="{referencia}" {place_referencia} >
                                       <span>{span_referencia}</span>
                            </div>
                        </section>
                        <section>
                            <label for="nome">{lang_title_nome}</label>
                            <div>
                                <input title="{lang_title_nome}" type="text" id="nome" name="nome" value="{nome}" {place_nome} required="required">
                                       <span>{span_nome}</span>
                            </div>
                        </section>
                        <section>
                            <label>{lang_title_nascimento}</label>
                            <div>
                                <input type="text" readonly="true" id="data" name="data"  value="{data}" {place_nascimento} required="required">
                                       <span>{span_nascimento}</span>
                            </div>
                        </section>
                        <section>
                            <label for="cpf">{lang_title_cpf}</label>
                            <div>
                                <input title="{lang_title_cpf}" maxlength="11" type="text" id="cpf" name="cpf" value="{cpf}" data-regex="^[0-9 ]+$" {place_cpf} required="required"/>
                                       <span>{span_cpf}</span>
                            </div>
                        </section>
                        <section>
                            <label for="email">{lang_title_email}</label>
                            <div>
                                <input title="{lang_title_email}" type="email" id="email" name="email" value="{email}" {place_email} required="required"/>
                                       <span>{span_email}</span>
                            </div>
                        </section>
                        <section>
                            <label for="telefone">{lang_title_telefone}</label>
                            <div>
                                <input title="{lang_title_telefone}" type="text" id="telefone" name="telefone" value="{telefone}" required="required"/>
                                <span>{span_telefone}</span>
                            </div>
                        </section>
                        <section>
                            <label for="pais">{lang_title_pais}</label>
                            <div>
                                <input title="{lang_title_pais}" maxlength="2" data-regex="^[a-zA-Z ]+$" type="text" id="pais" name="pais" value="{pais}" {place_pais} required="required"/>
                                       <span>{span_pais}</span>
                            </div>
                        </section>
                        <section>
                            <label for="cep">{lang_title_cep}</label>
                            <div>
                                <input title="{lang_title_cep}" maxlength="8" type="text" id="cep" name="cep" value="{cep}" data-regex="^[0-9 ]+$" {place_cep} required="required"/>
                                       <span>{span_cep}</span>
                            </div>
                        </section>
                        <section>
                            <label for="logradouro">{lang_title_logradouro}</label>
                            <div>
                                <input title="{lang_title_logradouro}" type="text" id="logradouro" name="logradouro" value="{logradouro}" {place_logradouro} required="required"/>
                                       <span>{span_logradouro}</span>
                            </div>
                        </section>
                        <section>
                            <label for="endereco">{lang_title_endereco}</label>
                            <div>
                                <input title="{lang_title_endereco}" type="text" id="endereco" name="endereco" value="{endereco}" {place_endereco} required="required"/>
                                       <span>{span_endereco}</span>
                            </div>
                        </section>
                        <section>
                            <label for="numero">{lang_title_numero}</label>
                            <div>
                                <input title="{lang_title_numero}" type="text" id="numero" name="numero" value="{numero}" {place_numero} required="required"/>
                            </div>
                        </section>
                        <section>
                            <label for="complemento">{lang_title_complemento}</label>
                            <div>
                                <input title="{lang_title_complemento}" type="text" id="complemento" name="complemento" value="{complemento}" {place_complemento}/>
                                       <span>{span_complemento}</span>
                            </div>
                        </section>
                        <section>
                            <label for="bairro">{lang_title_bairro}</label>
                            <div>
                                <input title="{lang_title_bairro}" type="text" id="bairro" name="bairro" value="{bairro}" {place_bairro} required="required"/>
                                       <span>{span_bairro}</span>
                            </div>
                        </section>
                        <section>
                            <label for="cidade">{lang_title_cidade}</label>
                            <div>
                                <input title="{lang_title_cidade}" type="text" id="cidade" name="cidade" value="{cidade}" {place_cidade} required="required"/>
                                       <span>{span_cidade}</span>
                            </div>
                        </section>
                        <section>
                            <label for="uf">{lang_title_uf}</label>
                            <div>
                                <input title="{lang_title_uf}" maxlength="2" data-regex="^[a-zA-Z ]+$" type="text" id="uf" value="{estado}" name="uf" {place_uf} required="required"/>
                                       <span>{span_uf}</span>
                            </div>
                        </section>
                        <!--section>
                            <div>
                                <input type="checkbox" name="entrega" id="entrega" checked="checked"><i>{lang_title_entrega}</i><br>
                            </div>
                        </section-->
                    </fieldset>
                    <!--/form>
    
                    <form id="form_dados_entrega" name="form_dados_entrega" action="{base_cms}{action_pessoa_endereco_entrega}" method="post" autocomplete="off"-->
                    <!--input type="hidden" value="{id}" name="id" id="id"-->


                    <!--fieldset id="dados_entrega" >
                        <label>{title_entrega} </label>
                        <section>
                            <label for="pais_entrega">{lang_title_pais}&nbsp;<span class="required"></span></label>
                            <div>
                                <input title="{lang_title_pais}" maxlength="2" data-regex="^[a-zA-Z ]+$" type="text" id="pais_entrega" name="pais_entrega" value="{pais_entrega}" {place_pais} >
                                       <span>{span_pais}</span>
                            </div>
                        </section>
                        <section>
                            <label for="cep_entrega">{lang_title_cep}&nbsp;<span class="required"></span></label>
                            <div>
                                <input title="{lang_title_cep}" type="text" maxlength="8" id="cep_entrega" name="cep_entrega" value="{cep_entrega}" data-regex="^[0-9 ]+$" {place_cep} >
                                       <span>{span_cep}</span>
                            </div>
                        </section>
                        <section>
                            <label for="logradouro_entrega">{lang_title_logradouro}&nbsp;<span class="required"></span></label>
                            <div>
                                <input title="{lang_title_logradouro}" type="text" id="logradouro_entrega" name="logradouro_entrega" value="{logradouro_entrega}" {place_logradouro} >
                                       <span>{span_logradouro}</span>
                            </div>
                        </section>
                        <section>
                            <label for="endereco_entrega">{lang_title_endereco}&nbsp;<span class="required"></span></label>
                            <div>
                                <input title="{lang_title_endereco}" type="text" id="endereco_entrega" name="endereco_entrega" value="{endereco_entrega}" {place_endereco} >
                                       <span>{span_endereco}</span>
                            </div>
                        </section>
                        <section>
                            <label for="numero_entrega">{lang_title_numero}&nbsp;<span class="required"></span></label>
                            <div>
                                <input title="{lang_title_numero}" type="text" id="numero_entrega" name="numero_entrega" value="{numero_entrega}" {place_numero} >
                            </div>
                        </section>
                        <section>
                            <label for="complemento_entrega">{lang_title_complemento}</label>
                            <div>
                                <input title="{lang_title_complemento}" type="text" id="complemento_entrega" name="complemento_entrega" value="{complemento_entrega}" {place_complemento} />
                                       <span>{span_complemento}</span>
                            </div>
                        </section>
                        <section>
                            <label for="bairro_entrega">{lang_title_bairro}&nbsp;<span class="required"></span></label>
                            <div>
                                <input title="{lang_title_bairro}" type="text" id="bairro_entrega" name="bairro_entrega" value="{bairro_entrega}" {place_bairro} >
                                       <span>{span_bairro}</span>
                            </div>
                        </section>
                        <section>
                            <label for="cidade_entrega">{lang_title_cidade}&nbsp;<span class="required"></span></label>
                            <div>
                                <input title="{lang_title_cidade}" type="text" id="cidade_entrega" name="cidade_entrega" value="{cidade_entrega}" {place_cidade} >
                                       <span>{span_cidade}</span>
                            </div>
                        </section>
                        <section>
                            <label for="uf_entrega">{lang_title_uf}&nbsp;<span class="required"></span></label>
                            <div>
                                <input title="{lang_title_uf}" type="text" maxlength="2" data-regex="^[a-zA-Z ]+$" id="uf_entrega" name="uf_entrega" value="{uf_entrega}" {place_uf} >
                                       <span>{span_uf}</span>
                            </div>
                        </section>
                    </fieldset-->
                    <fieldset>
                        <section>
                            <div>
                                <!--button class="reset">{lang_title_reset}</button-->
                                <button class="submit">{lang_title_submit}</button>
                            </div>
                        </section>
                    </fieldset>
                </form>
            </div>
        </section>
        <footer>
            {include_footer_view}
        </footer>
    </body>
</html>